{extend name="../../public/admin"}
{block name="title"}数据字典{/block}
{block name="css"}
<link rel="stylesheet" href="__PUBLIC__/admin/css/index.dictionaries.css">
{/block}
{block name="body"}
<div id="container">
    <div class="clearfix"></div>
    <div style="height: 20px;"></div>
    <div class="table-responsive" id="header">
        <table class="table table-bordered table-hover" v-cloak>
            <thead>
            <tr class="active">
                <th colspan="13">
                    <span class="fa-pull-right">总 <strong>{{list.length}}</strong> 条</span>
                </th>
            </tr>
            <tr class="active">
                <th>{:lang('序号')}</th>
                <th>支付</th>
                <th>{:lang('图片')}</th>
                <th>{:lang('时间')}</th>
                <th>{:lang('操作')}</th>
            </tr>
            </thead>
            <tbody>
            <template v-for="(key,index) in list">
                <tr>
                    <td>{{index+1}}</td>
                    <td>{{key.money}}</td>
                    <td><a href="javascript:;" onclick="loock_img($(this))" :data-img="key.img">{:lang('查看')}</a></td>
                    <td>{{key.time}}</td>
                    <td>
                        <a href="javascript:;" title="删除" @click="del(index)"><i class="fa fa-trash-o"></i></a>
                    </td>
                </tr>
            </template>
            </tbody>
        </table>
    </div>
    <div id="Pagination"></div>

</div>
{/block}
{block name="js"}


<script>
    var app = new Vue({
        el: '#container',
        data: {
            list: []
        }
    });
    app.del = (i)=>{
        layer.confirm("{:lang('是否确定')}",function () {
            $.post("{:url('del_money')}",{id:app.list[i].id},function (da) {
                if(da == 1){
                    layer.msg("{:lang('成功')}",{icon:1,offset:'rb'})
                }else{
                    layer.msg("{:lang('失败')}",{icon:2,offset:'rb'})
                }
                get_data();
            })
        })
    }
    get_data();

    //获取数据
    function get_data() {
        var index = layer.load(1);
        $.get("{:url('count/loock',['id'=>$Request.param.id])}", function (da) {
            app.list = da;
            layer.close(index);
        });
    }

    //查看图片
    app.imgLock = (url)=>{
        layer.open({
            type:2,
            title:'查看文件',
            shift:'3',
            area:['100%','100%'],
            content:url
        })
    }





    //添加内容
    app.addData = () => {
        layer.open({
            type:2,
            area:['500px','400px'],
            content:"{:url('count/addd',['id'=>$Request.param.id])}"
        })
    }
</script>
{/block}